package com.glory.hikvisionmobile.adapter;

import android.text.TextUtils;
import android.view.Gravity;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.hikvisionmobile.R;
import com.glory.hikvisionmobile.bean.material.XPdaMLot;
import com.glory.hikvisionmobile.customView.HikTabView;

import java.util.ArrayList;
import java.util.List;

/**
 * *****************************
 *
 * @Anthor yazhou
 * @Email 1184545990@qq.com
 * @Time 2020/4/2 18:55
 * @DESC *****************************
 */
public class MaterialAdapter extends BaseQuickAdapter<XPdaMLot, BaseViewHolder> {

    public MaterialAdapter(@Nullable List<XPdaMLot> data) {
        super(R.layout.item_material, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, XPdaMLot item) {
        HikTabView hikTabView = helper.getView(R.id.tabView);
        HikTabView.Tab tab1 = new HikTabView.Tab(item.getMaterialName(), 2, Gravity.CENTER);
        HikTabView.Tab tab2 = new HikTabView.Tab(item.getMaterialDesc(), 2, Gravity.CENTER);
        HikTabView.Tab tab3 = new HikTabView.Tab(item.getmLotId(), 2, Gravity.CENTER);
        HikTabView.Tab tab4 = new HikTabView.Tab(item.getCharg(), 2, Gravity.CENTER);
        HikTabView.Tab tab5 = new HikTabView.Tab(item.getLYQty(), 2, Gravity.CENTER);
        hikTabView.setTabs(tab1, tab2, tab3, tab4, tab5);
    }
}
